package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCompanyMapper;
import com.ruoyi.system.domain.SysCompany;
import com.ruoyi.system.service.ISysCompanyService;

/**
 * 资质主体Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-31
 */
@Service
public class SysCompanyServiceImpl implements ISysCompanyService 
{
    @Autowired
    private SysCompanyMapper sysCompanyMapper;

    /**
     * 查询资质主体
     * 
     * @param id 资质主体主键
     * @return 资质主体
     */
    @Override
    public SysCompany selectSysCompanyById(Integer id)
    {
        return sysCompanyMapper.selectSysCompanyById(id);
    }

    /**
     * 查询资质主体
     *
     * @param name 资质主体name
     * @return 资质主体
     */
    @Override
    public SysCompany selectSysCompanyByName(String name)
    {
        return sysCompanyMapper.selectSysCompanyByName(name);
    }

    /**
     * 查询资质主体列表
     * 
     * @param sysCompany 资质主体
     * @return 资质主体
     */
    @Override
    public List<SysCompany> selectSysCompanyList(SysCompany sysCompany)
    {
        return sysCompanyMapper.selectSysCompanyList(sysCompany);
    }

    /**
     * 新增资质主体
     * 
     * @param sysCompany 资质主体
     * @return 结果
     */
    @Override
    public int insertSysCompany(SysCompany sysCompany)
    {
        sysCompany.setCreateTime(DateUtils.getNowDate());
        return sysCompanyMapper.insertSysCompany(sysCompany);
    }

    /**
     * 修改资质主体
     * 
     * @param sysCompany 资质主体
     * @return 结果
     */
    @Override
    public int updateSysCompany(SysCompany sysCompany)
    {
        sysCompany.setUpdateTime(DateUtils.getNowDate());
        return sysCompanyMapper.updateSysCompany(sysCompany);
    }

    /**
     * 批量删除资质主体
     * 
     * @param ids 需要删除的资质主体主键
     * @return 结果
     */
    @Override
    public int deleteSysCompanyByIds(Integer[] ids)
    {
        return sysCompanyMapper.deleteSysCompanyByIds(ids);
    }

    /**
     * 删除资质主体信息
     * 
     * @param id 资质主体主键
     * @return 结果
     */
    @Override
    public int deleteSysCompanyById(Integer id)
    {
        return sysCompanyMapper.deleteSysCompanyById(id);
    }
}
